<include file="Public/frame-header" />
</head>
<body class="J_scroll_fixed" style="min-width:800px;">
<div class="wrap J_check_wrap">
	<ul class="nav nav-tabs">
	   <li class="active"><a href="{:U('Order/index')}">所有订单</a></li>
	</ul>
	<form class="well form-search" method="get" action="{:U('Order/index')}">
		<div class="search_type cc mb10">
			<div class="mb10">
				<span class="mr20">分类： 
					手机号： <input type="text" name="mobile" value="" style="width: 200px;" placeholder="手机号"> &nbsp;&nbsp;
					订单编号： <input type="text" name="order_number" value="" style="width: 200px;" placeholder="订单编号"> &nbsp;&nbsp;
					<br>
					下单时间： <input type="text" name="start_time" class="J_date" value="{$formget.start_time|default=''}" style="width: 80px;" autocomplete="off">-
						<input type="text" class="J_date" name="end_time" value="{$formget.end_time}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
					
					预约时间： 
					 <input type="text" name="order_time" class="J_date" value="{$formget.start_time|default=''}" style="width: 80px;" autocomplete="off">
					<input type="submit" class="btn btn-primary" value="搜索">
				</span>
			</div>
		</div>
	</form>
	<form class="J_ajaxForm" action="" method="post">
		<div class="table-actions">
			<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" 
			data-action="{:u('/Admin/Order/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
		</div>
		<table class="table table-hover table-bordered table-list">
			<thead>
				<tr>
					<th width="15"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></th>
					<th width="50">ID</th>
					<th width="100">订单编号</th>
					<th>服务项目</th>
					<th>美容院</th>
					<th>美容师</th>
					<th width="100">用户名/姓名</th>
					<th width="100">手机号</th>
					<th>价格</th>
					<th>服务时长</th>
					<th>订单状态</th>
					<th>预约时间</th>
					<th>创建时间</th>
					<th width="50">操作</th>
				</tr>
			</thead>
			<php>$status=array("1"=>"已审核","0"=>"未审核");</php>
			<foreach name="list" item="vo">
			<tr>
				<td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.id}" ></td>
				<td>{$vo.id}</td>
				<td>{$vo.order_number}</td>
				<td>{$vo.service_name}</td>
				<td >{$vo.beauty_name}</td>
				<td >{$vo.beautician_name}</td>
				<td >{$vo.username}</td>
				<td >{$vo.mobile}</td>
				<td >{$vo.price}</td>
				<td >{$vo.service_time}分</td>
				<td ><eq name="vo.status" value="1">已付款</eq>
				<eq name="vo.status" value="2">待付款</eq>
				<eq name="vo.status" value="3">正在服务</eq>
				<eq name="vo.status" value="4">完成服务</eq>
				<eq name="vo.status" value="5">已取消</eq>
				<eq name="vo.status" value="0">已删除</eq>
				<eq name="vo.status" value="7">退款中</eq>
				</td>
				<td >{$vo.order_time|date="Y-m-d H:i:s",###}</td>
				<td >{$vo.created|date="Y-m-d H:i:s",###}</td>
				<td >
					<a target="_blank" href="{:U('/Admin/Order/detail/id/'.$vo['id'])}">详情</a>
					<if condition="$vo['status'] eq 1">
					<a href="{:U('/Admin/Order/change/id/'.$vo['id'])}" title="改签时间选择" class="J_ajax_change">改签</a>
					<a href="{:U('/Admin/Order/refund/id/'.$vo['id'])}">退款</a>
					</if>
					<if condition="$vo['status'] neq 0">
					<a href="{:U('/Admin/Order/delete',array('id'=>$vo['id']))}" class="J_ajax_del" >删除</a>
					</if>
				</td>
			</tr>
			</foreach>
		    <tfoot>
				<tr>
					<th width="15"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></th>
					<th width="50">ID</th>
					<th width="100">订单编号</th>
					<th>服务项目</th>
					<th>美容院</th>
					<th>美容师</th>
					<th width="100">用户名/姓名</th>
					<th width="80">手机号</th>
					<th>价格</th>
					<th>服务时长</th>
					<th>订单状态</th>
					<th>预约时间</th>
					<th>创建时间</th>
					<th width="100">操作</th>
				</tr>
			</tfoot>
		</table>
		<div class="table-actions">
			<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" 
			data-action="{:u('/Admin/Order/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
		</div>
		<div class="pagination">{$Page}</div>
	</form>
</div>
<script src="__ADMIN__/statics/js/common.js"></script>
<script>
$(function () {
	Wind.use('artDialog', 'iframeTools', function () {
        $('.J_ajax_change').on('click', function (e) {
            e.preventDefault();
            var $_this = this,
                _this = $($_this);
            art.dialog.open($(this).prop('href'), {
            	height:356,
                close: function () {
                    $_this.focus(); //关闭时让触发弹窗的元素获取焦点
                    return true;
                },
                title: _this.prop('title')
            });
        }).attr('role', 'button');
    });
})
</script>
</body>
</html>
